home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 13 / Hobby PC 13.iso / assets / Asset Library / Multimedia / Java Applets / Message Ticker / fxitems.xml < prev    next >
Extensible Markup Language  |  2001-04-09  |  7KB  |  130 lines

  1. <?xml version="1.0" standalone="yes"?>
  2.  
  3. <Items>
  4.  
  5. <Item CLASS="ticker" TYPE="TEXT" ID="ticker">
  6.     <Icon SRC="../java.gif"/>
  7.     <FileName SRC="Ticker.class"/>
  8.     <Title><![CDATA[<B><I>Text Ticker Applet</I></B>]]></Title>
  9.     <Description><![CDATA[This applet takes text strings and scrolls them through a text strip. Any number of text strings may be entered; they will be processed sequentially.]]></Description>
  10.     <SCRIPT LANGUAGE="JSCRIPT"><![CDATA[
  11.     var src, dest, attr, defval;
  12.     src = "%Pathname%" + "%thisItem.SQ_getChildAttribute(Filename, 0, SRC)%";
  13.  
  14.     var valparamText1 = '%htmlItem.SQ_getAttribute("parText1",0,"VALUE")%';
  15.     var valparamText2 = '%htmlItem.SQ_getAttribute("parText2",0,"VALUE")%';
  16.     var valparamText3 = '%htmlItem.SQ_getAttribute("parText3",0,"VALUE")%';
  17.     var valparamText4 = '%htmlItem.SQ_getAttribute("parText4",0,"VALUE")%';
  18.     var valparamText5 = '%htmlItem.SQ_getAttribute("parText5",0,"VALUE")%';
  19.     var valappletWidth = '%htmlItem.SQ_getAttribute("appWidth",0,"VALUE")%';
  20.     var valappletHeight = '%htmlItem.SQ_getAttribute("appHeight",0,"VALUE")%';
  21.     var valparamAppBGColor = '%htmlItem.SQ_getAttribute("parAppBGColor",0,"VALUE")%';
  22.     var valparamPointSize = '%htmlItem.SQ_getAttribute("parPointSize",0,"VALUE")%';
  23.     var valparamFont = '%htmlItem.SQ_getAttribute("parFont",0,"VALUE")%';
  24.     var valparamTextColor = '%htmlItem.SQ_getAttribute("parTextColor",0,"VALUE")%';
  25.     var valparamStyle = '%htmlItem.SQ_getAttribute("parStyle",0,"VALUE")%';
  26.     var valparamHorizCenter = '%htmlItem.SQ_getAttribute("parHorizCenter",0,"VALUE")%';
  27.     var valparamVertCenter = '%htmlItem.SQ_getAttribute("parVertCenter",0,"VALUE")%';
  28.     var valparamAppBGImage = '%htmlItem.SQ_getAttribute("parAppBGImage",0,"VALUE")%';
  29.     var valparamAppTile = '%htmlItem.SQ_getAttribute("parAppTile",0,"VALUE")%';
  30.     var valparamDelayBetweenChars = '%htmlItem.SQ_getAttribute("parDelayBetweenChars",0,"VALUE")%';
  31.     var valparamDelayBetweenRuns = '%htmlItem.SQ_getAttribute("parDelayBetweenRuns",0,"VALUE")%';
  32.     var valparamXOffset = '%htmlItem.SQ_getAttribute("parXOffset",0,"VALUE")%';
  33.     var valparamYOffset = '%htmlItem.SQ_getAttribute("parYOffset",0,"VALUE")%';
  34.     var valparamSteps = '%htmlItem.SQ_getAttribute("parSteps",0,"VALUE")%';
  35.     var valparamTextCount = '%htmlItem.SQ_getAttribute("parTextCount",0,"VALUE")%';
  36.     var valparamMoveDist = '%htmlItem.SQ_getAttribute("parMoveDist",0,"VALUE")%';
  37.     var valparamReverse = '%htmlItem.SQ_getAttribute("parReverse",0,"VALUE")%';
  38.  
  39.     function dropfxnow()
  40.         {
  41.         if (valparamText1 == "")
  42.             {
  43.                   ans = Application.MessageBox("Please enter a text string in the appropriate field.", 0, "Text Ticker Applet");
  44.             }
  45.         else
  46.             {
  47.             var applethtml = '<APPLET CODE="Ticker.class" CODEBASE="' + attr + '" HEIGHT="' + valappletHeight + '" WIDTH="' + valappletWidth +'" ID="' + ActiveDocument.UniqueAttributeValue("ID","ticker") + '" ALT="' + valparamText1 + '"><PARAM NAME="Text1" VALUE="' + valparamText1 + '">';
  48.             if (valparamTextCount != "") {applethtml += '<PARAM NAME="TextCount" VALUE="' + valparamTextCount + '">'};
  49.             if (valparamMoveDist != "") {applethtml += '<PARAM NAME="MoveDist" VALUE="' + valparamMoveDist + '">'};
  50.             if (valparamReverse != "") {applethtml += '<PARAM NAME="Reverse" VALUE="' + valparamReverse + '">'};
  51.             if (valparamText2 != "") {applethtml += '<PARAM NAME="Text2" VALUE="' + valparamText2 + '">'};
  52.             if (valparamText3 != "") {applethtml += '<PARAM NAME="Text3" VALUE="' + valparamText3 + '">'};
  53.             if (valparamText4 != "") {applethtml += '<PARAM NAME="Text4" VALUE="' + valparamText4 + '">'};
  54.             if (valparamText5 != "") {applethtml += '<PARAM NAME="Text5" VALUE="' + valparamText5 + '">'};
  55.             if (valparamAppBGColor != "") {applethtml += '<PARAM NAME="AppBGColor" VALUE="' + valparamAppBGColor + '">'};
  56.             if (valparamPointSize != "") {applethtml += '<PARAM NAME="PointSize" VALUE="' + valparamPointSize + '">'};
  57.             if (valparamFont != "") {applethtml += '<PARAM NAME="Font" VALUE="' + valparamFont + '">'};
  58.             if (valparamTextColor != "") {applethtml += '<PARAM NAME="TextColor" VALUE="' + valparamTextColor + '">'};
  59.             if (valparamStyle != "") {applethtml += '<PARAM NAME="Style" VALUE="' + valparamStyle + '">'};
  60.             if (valparamHorizCenter != "") {applethtml += '<PARAM NAME="HorizCenter" VALUE="' + valparamHorizCenter + '">'};
  61.             if (valparamVertCenter != "") {applethtml += '<PARAM NAME="VertCenter" VALUE="' + valparamVertCenter + '">'};
  62.             if (valparamAppBGImage != "") {applethtml += '<PARAM NAME="AppBGImage" VALUE="' + valparamAppBGImage + '">'};
  63.             if (valparamAppTile != "") {applethtml += '<PARAM NAME="AppTile" VALUE="' + valparamAppTile + '">'};
  64.             if (valparamDelayBetweenChars != "") {applethtml += '<PARAM NAME="DelayBetweenChars" VALUE="' + valparamDelayBetweenChars + '">'};
  65.             if (valparamDelayBetweenRuns != "") {applethtml += '<PARAM NAME="DelayBetweenRuns" VALUE="' + valparamDelayBetweenRuns + '">'};
  66.             if (valparamXOffset != "") {applethtml += '<PARAM NAME="XOffset" VALUE="' + valparamXOffset + '">'};
  67.             if (valparamYOffset != "") {applethtml += '<PARAM NAME="YOffset" VALUE="' + valparamYOffset + '">'};
  68.             if (valparamSteps != "") {applethtml += '<PARAM NAME="Steps" VALUE="' + valparamSteps + '">'};
  69.             applethtml += '</APPLET>'; 
  70.                   Application.FX.HTML(applethtml);
  71.                   Application.FX.CopyFile(src,dst + '%Filename%');
  72.             }
  73.         }
  74.  
  75.     //modify the section above; it is unique to each validating form field
  76.  
  77.     function buildpath()
  78.         {
  79.         if (ActiveDocument.InCurrentProject)
  80.             {
  81.             dst = Application.ProjectDirectory + "\\applets\\ticker\\";
  82.                   attr = Application.PathToURL(dst, ActiveDocument.LocalPath);
  83.             }
  84.         else
  85.             {
  86.             dst = ActiveDocument.LocalPath + "\\applets\\ticker\\";
  87.             attr = "applets/ticker/";
  88.             }
  89.         }
  90.  
  91.     function prepdrop()
  92.         {
  93.         var isittext;
  94.         Application.FX.SelectDropPoint();
  95.         if (Selection.IsParentElement("BODY") == true)
  96.             {
  97.             Application.FX.SelectDropPoint();
  98.             dropfxnow();
  99.             }                    
  100.         else
  101.             {
  102.             ans = Application.MessageBox("Please drop the object inside the BODY element.", 0, "Text Ticker Applet");
  103.             }
  104.         }
  105.  
  106.     if (ActiveDocument.LocalPath != "")     // First, check if the file is saved
  107.         {
  108.         buildpath(); //build the path to the external file based on whether or not document is part of open project
  109.         prepdrop();  //determine whether or not it is legal to drop the form element at this location, or make it so
  110.         }
  111.     else
  112.         {
  113.         ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
  114.  
  115.         if (ans == 1)
  116.             {
  117.             ActiveDocument.SaveAs();
  118.             }
  119.         if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
  120.             {
  121.             buildpath();
  122.             prepdrop();
  123.             }
  124.         }
  125.     
  126. //    ]]></SCRIPT>
  127. </Item>
  128.  
  129.  
  130. </Items>